package com.buba.system.pojo;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 菜单类
 * @Data 有get set toString hashCode equals
 */
@Data
public class Menu implements Comparable<Menu>, Serializable {
    private Integer menuId;
    private String menuName;
    private String menuUrl;
    private Integer menuPid;
    //用于装该菜单下的子集
    private List<Menu> subMenu;
    //zTree 展示的属性
    //open表示是否自动展开节点
    private boolean open = false;
    //checked表示是否选中该节点
    private boolean checked = false;


    @Override
    public int compareTo(Menu o) {
        if(this.getMenuId()>o.getMenuId()){
            return 1;
        }else if (this.getMenuId()<o.getMenuId()){
            return -1;
        }
        return 0;
    }
}
